package com.kuang.service.impl;

import com.kuang.dao.CommentMapper;
import com.kuang.pojo.Comment;
import com.kuang.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<Comment> selectCommentPage(Integer pageindex, Integer pagesize) {
        return commentMapper.selectCommentPage(pageindex, pagesize);
    }

    @Override
    public int countComment() {
        return commentMapper.countComment();
    }

    @Override
    public int deletecommentById(Integer commentid) {
        return commentMapper.deletecommentById(commentid);
    }

    @Override
    public int insertComment(Comment comment) {
        return commentMapper.insertComment(comment);
    }

    @Override
    public List<Comment> selectAllCommentByBlogId(Integer blogid) {
        return commentMapper.selectAllCommentByBlogId(blogid);
    }

    @Override
    public Comment selectSingleComment() {
        return commentMapper.selectSingleComment();
    }
}
